#pragma once
#include "DGeometry.h"

namespace Skill
{
	namespace Ode
	{
		ref class DMatrix4;
		ref class DVector3;
		ref class DSpace;

		namespace Geometries
		{			
			public ref class DRay : DGeometry
			{
			protected:
				virtual void CollectManagedMemory() override;
			public:
				DRay(DSpace^ space, dReal length);
				
				VALUE_PROP_DECLARATION_GETSET(dReal,Length);

				REF_PROP_DECLARATION_GETSET(DVector3,Start);
				REF_PROP_DECLARATION_GETSET(DVector3,Direction);

				void Set(dReal px, dReal py, dReal pz,
						dReal dx, dReal dy, dReal dz);
				void Set(DVector3^ start,DVector3^ direction);

				void Get(DVector3^ %start,DVector3^ %direction);

				///<summary>
				/// Set ray flags that influence ray collision detection.
				/// These flags are currently only noticed by the trimesh collider, because
				/// they can make a major differences there.
				///</summary>
				void SetParams(int firstContact, int backfaceCull);

				///<summary>
				/// Get ray flags that influence ray collision detection.
				/// These flags are currently only noticed by the trimesh collider, because
				/// they can make a major differences there.
				///</summary>
				void GetParams([OutAttribute] int %firstContact, [OutAttribute] int %backfaceCull);

				VALUE_PROP_DECLARATION_GETSET(int,ClosestHit);
			};
		}
	}
}